﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="GateOr.cs" company="pwasiewicz">
//   pwasiewicz
// </copyright>
// <summary>
//   Defines the GateOr type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace LogicSystem.LogicGates
{
    using System.Linq;

    /// <summary>The gate or.</summary>
    public class GateOr : LogicGate
    {
        /// <summary>Initializes a new instance of the <see cref="GateOr"/> class.</summary>
        internal GateOr()
        {
        }

        /// <summary>
        /// Gets the latency;
        /// </summary>
        public override int Latency
        {
            get { return 10; }
        }

        /// <summary>
        /// Computes output wire state.
        /// </summary>
        /// <returns>The gate's state.</returns>
        public override bool ComputeOutput()
        {
            return this.InputWires.Any(wire => wire.State);
        }
    }
}
